#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 3e3 + 10, M = 3e3 + 10;
int d[N][M], dx[4]{-1, 0, 1, 0}, dy[4]{0, 1, 0, -1};

// 次小
int sec(int x, int y) {
  vector<int> v = {d[x][y - 1], d[x][y + 1], d[x - 1][y], d[x + 1][y]};
  sort(v.begin(), v.end());
  return v[1];
}
signed main() {
  int n, m, k;
  memset(d, 0x3f, sizeof d);
  cin >> n >> m >> k;
  queue<pair<int, int>> q;
  for (int i = 1; i <= k; i++) {
    int x, y;
    cin >> x >> y;
    d[x][y] = 0;
    q.push({x, y});
  }
  while (!q.empty()) {
    int x, y;
    tie(x, y) = q.front();
    q.pop();
    for (int i = 0; i < 4; i++) {
      int nx = x + dx[i], ny = y + dy[i];
      if (nx < 1 || nx > n || ny < 1 || ny > m)
        continue;
      int t = sec(nx, ny);
      if (t + 1 < d[nx][ny]) {
        d[nx][ny] = t + 1;
        q.push({nx, ny});
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (d[i][j] != d[0][0]) {
        ans += d[i][j];
      }
    }
  }
  cout << ans << "\n";
  return 0;
}